<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>新增邮箱</title>
<script src='/dwr/util.js'></script>
<script src='/dwr/engine.js'></script>
<script src='/dwr/interface/MailHostAction.js'></script>
<script    type="text/javascript">
function fillAddress() {
	var mail = dwr.util.getValue("mail");
	MailHostAction.getMailHostByMail(mail, function(mailHost) {
		console.info(mailHost);
		dwr.util.setValues(mailHost);
	});
}
</script>
</head>
<body>
<h2>新增邮箱</h2>
<form action="/MailHostServlet" method="post">
<input type="hidden" name="type" value="add">
	<table>
		<tbody>
			<tr>
				<td>邮箱</td>
				<td><input  type="text" name="mail" id ="mail" onblur="fillAddress()"></td>
			</tr>
			<tr>
				<td>用户名</td>
				<td><input  type="text" name="userName" id="userName"></td>
			</tr>
			<tr>
				<td>密码</td>
				<td><input  type="text" name="password" id="userName"></td>
			</tr>
			<tr>
				<td>邮件服务器</td>
				<td><input  type="text" name="hostName" id="hostName"></td>
			</tr>
			<tr>
				<td>邮箱类型</td>
				<td><input  type="text" name="kind" id="kind">(如sina,163,21cn等)</td>
			</tr>
			<tr>
				<td>一次发送最大数量</td>
				<td><input  type="text" name="sendOnceMaxCount" value="1" id="sendOnceMaxCount"></td>
			</tr>
			<tr>
				<td>每天发送最大数量</td>
				<td><input  type="text" name="sendDayMaxCount" id="sendDayMaxCount" value="100"></td>
			</tr>
			<tr>
				<td>是否ssl连接</td>
				<td><input  type="checkbox" name="ssl" value="true" id="ssl"></td>
			</tr>
		</tbody>
	</table>
	接受邮箱<input type="text" id="toMail">
	<input type="button" value="测试邮箱是否能发送"  onclick="checkMail();">
	<input type="submit">
	</form>
</body>
</html>